//
//  TestSliderController.m
//  ProjectDemo
//
//  Created by IOS3 on 2018/11/21.
//  Copyright © 2018 IOS3. All rights reserved.
//

#import "TestSliderController.h"
#import "RedController.h"
#import "GreenController.h"
#import "BlueController.h"

@implementation TestSliderController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.menuViewLayoutMode = WMMenuViewLayoutModeLeft;
    self.menuViewStyle = WMMenuViewStyleLine;
    self.showOnNavigationBar = true;

}

- (NSString *)menuView:(WMMenuView *)menu titleAtIndex:(NSInteger)index {
    if (index == 0) {
        return @"red";
    }
    else if (index == 1) {
        return @"green";
    }
    else if (index == 2) {
        return @"blue";
    }
    return @"default";
}

//- (CGRect)pageController:(WMPageController *)pageController preferredFrameForMenuView:(WMMenuView *)menuView {
//
//    return CGRectZero;
//}

- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController {
    return 3;
}

- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    if (index == 0) {
        return RedController.new;
    }
    else if (index == 1) {
        return GreenController.new;
    }
    else if (index == 2) {
        return BlueController.new;
    }
    return UIViewController.new;
}

@end
